#ifndef xpack_meta_function
#define xpack_meta_function
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::meta_function::inc
#include"define/base_type.hpp"
#include"macro/xexport.hpp"
#include"meta_seq/tlist.hpp"
#include"meta_seq/tget.hpp"
#pragma pop_macro("xuser")

namespace mixc::meta_function{
    template<class type_t> struct function;

    template<class ret_t, class ... args_t>
    struct function<ret_t(args_t...)> {
        static constexpr uxx args_count = sizeof...(args_t);

        template<ixx index>
        using args = inc::tget<inc::tlist<args_t...>, index>;
        using return_type = ret_t;
    };

    template<class ret_t, class ... args_t>
    struct function<ret_t(*)(args_t...)> {
        static constexpr uxx args_count = sizeof...(args_t);

        template<ixx index>
        using args = inc::tget<inc::tlist<args_t...>, index>;
        using return_type = ret_t;
    };

    template<class object_t, class ret_t, class ... args_t>
    struct function<ret_t(object_t::*)(args_t...)> {
        static constexpr uxx args_count = sizeof...(args_t);

        template<ixx index>
        using args = inc::tget<inc::tlist<args_t...>, index>;
        using return_type = ret_t;
    };

    template<class object_t, class ret_t, class ... args_t>
    struct function<ret_t(object_t::*)(args_t...) const> {
        static constexpr uxx args_count = sizeof...(args_t);

        template<ixx index>
        using args = inc::tget<inc::tlist<args_t...>, index>;
        using return_type = ret_t;
    };
}

#endif

xexport(mixc::meta_function::function)